Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mariadb version parsing #97

Merged
merged 3 commits into from
Jan 10, 2025
Merged

Fix mariadb version parsing #97

merged 3 commits into from
Jan 10, 2025

Conversation

SandakovMM
Copy link
Contributor

No description provided.

@SandakovMM SandakovMM self-assigned this Dec 20, 2024
@@ -17,6 +17,12 @@ def test_parse_utility_output(self):
self.assertEqual(php.minor, 6)
self.assertEqual(php.patch, 12)

def test_parse_utility_output_no_distrib(self):
php = mariadb.MariaDBVersion("mariadb from 11.6.2-MariaDB, client 15.2 for Linux (x86_64) using EditLine wrapper")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

naming vers or mariadb?

@@ -56,6 +56,13 @@ def _extract_from_mysql_util(self, util_output: str):
self.minor = int(minor_part)
self.patch = int(patch_part)

def _extract_from_mariadb_util(self, util_output: str):
# String example: "mariadb from 11.6.2-MariaDB, client 15.2 for Linux (x86_64) using EditLine wrapper"
major_part, minor_part, patch_part = util_output.split("from ")[1].split("-MariaDB")[0].split(".")[:3]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be more robust if we try to find the version with a regexp or maybe find first dot then track back the numbers...?

@SandakovMM SandakovMM requested a review from ukablan-wpc January 6, 2025 08:19
@SandakovMM SandakovMM force-pushed the fix-mariadb-version-parsing branch from cda810c to 4f355d7 Compare January 10, 2025 06:01
@SandakovMM SandakovMM merged commit fc94204 into main Jan 10, 2025
3 checks passed
@SandakovMM SandakovMM deleted the fix-mariadb-version-parsing branch January 10, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants